package org.java.test;

import org.assertj.core.internal.DeepDifference;

import java.util.HashMap;
import java.util.Iterator;
import java.util.TreeSet;

/**
 * @author WHQ
 * @version 1.0
 * @date 2022-3-21 0021 下午 2:12
 * 用户账户，存款
 */
public class Account {

    private double money;

    public synchronized void addMoney(double i){
        double newMoney=money+i;
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        money=newMoney;
    }

    public void show(){
        System.out.println("你好");
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public Account(double money) {
        this.money = money;
    }

    public Account() {
    }
}
